#ifndef WINDOW_H
#define WINDOW_H

#include <QtGui>
#include "histogramPanel.h"
#include "imageContainer.h"


class Window : public QMainWindow{
	Q_OBJECT

	public:
		Window();
		~Window();


    private slots:
        void open();
        void save();
        void saveAs();
        ImageContainer *newImage(QImage * = NULL);
//        void cut();
//        void copy();
//        void paste();
//        void about();

        void filterDlg(QString = tr(""));
        void operationDlg(QString = tr(""));
        void representationDlg(QString = tr(""));
        void pcaDlg();
        void normalSize();
        void zoomIn();
        void zoomOut();
        void fitToWindow();
        void changeOpenInNewTab(bool);

        void updateActions();
        void updateImage(int _index = 0);
        bool closeImage(int _index = 0);

        void openGrayscaleFilter();
        void openNegativeFilter();
        void openLogFilter();
        void openPowerFilter();
        void openThresholdingFilter();
        void openHistogramEqualizationFilter();
        void openHistogramMatchingFilter();
        void openLocalHistogramProcessingFilter();
        void openLocalHistogramProcessingWithStatisticsFilter();
        void openAverageFilter();
        void openWeightedAverageFilter();
        void openGaussianFilter();
        void openOrderStatisticFilter();
        void openLaplacianFilter();
        void openUnsharpMaskingAndHighBoostFilter();
        void openGradientFilter();

        void openAdditionOperation();
        void openSubtractionOperation();
        void openMultiplicationOperation();
        void openDivisionOperation();

        void openBoundaryFollowingRepresentation();
        void openChainCodeRepresentation();
        void openSplittingRepresentation();
        void openBasicDescriptors();
        void openMomentInvariantsDescriptors();
        void openHistogramDescriptors();


        void deleteLast();

    private:
        void createMenus();
        void createPanels();
        void createActions();
        void closeEvent(QCloseEvent *event);


        /* ações */
        QAction *openAct;
        QAction *saveAct;
        QAction *saveAsAct;
        QAction *exitAct;

        QAction *filterAct;
        QAction *operationAct;
        QAction *representationAct;
        QAction *pcaAct;

        QAction *normalSizeAct;
        QAction *zoomInAct;
        QAction *zoomOutAct;
        QAction *fitToWindowAct;
        QAction *viewHistogramPanelAct;
        QAction *openInNewTabAct;

        QAction *grayscaleAct;
        QAction *negativeAct;
        QAction *logAct;
        QAction *powerAct;
        QAction *thresholdingAct;
        QAction *histogramEqualizationAct;
        QAction *histogramMatchingAct;
        QAction *localHistogramProcessingAct;
        QAction *localHistogramProcessingWithStatisticsAct;
        QAction *averageAct;
        QAction *weightedAverageAct;
        QAction *gaussianAct;
        QAction *orderStatisticAct;
        QAction *laplacianAct;
        QAction *unsharpMaskingAndHighBoostFilterAct;
        QAction *gradientAct;

        QAction *additionAct;
        QAction *subtractionAct;
        QAction *multiplicationAct;
        QAction *divisionAct;

        QAction *boundaryFollowingAct;
        QAction *chainCodeAct;
        QAction *splittingAct;
        QAction *basicDescriptorsAct;
        QAction *momentInvariantsDescriptorsAct;
        QAction *histogramDescriptorsAct;

        QTabWidget *tab;
        bool openInNewTab;

        HistogramPanel *histogramPanel;
        QDockWidget *histogramPanelDock;
};

#endif
